<!DOCTYPE html>
<html lang="en">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>详情</title>
    <style>
        p{
            font-size: 15px;
            height: 30px;


        }




    </style>
</head>
<body>
<div id="user-details">
    <h1>详情</h1>
    <p><strong>学校:</strong> <span id="schoolname"></span></p>
    <p><strong>学院:</strong> <span id="yuanxi"></span></p>


    <p><strong>参赛选手:</strong> <span id="fuzerenname"></span></p>
    <p><strong>参赛选手联系方式:</strong> <span id="phone"></span></p>
    <p><strong>参赛选手微信/Email:</strong> <span id="weixin"></span></p>


    <p><strong>指导老师:</strong> <span id="teachername"></span></p>
    <p><strong>指导老师联系方式:</strong> <span id="teacherphine"></span></p>
    <p><strong>指导老师微信/Email:</strong> <span id="teacheremail"></span></p>

<!--

    <p><strong>地址:</strong> <span id="dizhi"></span></p>
    <p><strong>课题:</strong> <span id="type"></span></p>
    <p><strong>作品拟递交时间:</strong> <span id="shijianstart"></span> - <span id="shijainend"></span></p>
-->



    <p><strong>参赛作品名称:</strong><span id="timu"></span></p>
    <p style="height: 100px"><strong>参赛作品简介:</strong><br> <span id="jianjie"></span></p>
    <p style="height: 100px"><strong>备注:</strong> <br><span id="beizhu"></span></p>























    <div>
    <input type="hidden"    id="id" name="id"    th:value="${id}"  >


</div>



</div>

<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {


// 获取隐藏输入字段的值
        var id = $('#id').val();

// 然后您可以在需要的地方使用openid变量，比如打印到控制台
        console.log('id：' + id);

        $.ajax({
            url: '/selectById?id=' + id, // 根据您的实际接口地址进行修改

            method: 'GET',
            success: function(data) {
                var user = data.user;


                $('#fuzerenname').text(user.fuzerenname);
                $('#teacheremail').text(user.teacheremail);
                $('#schoolname').text(user.schoolname);
                $('#phone').text(user.phone);
                $('#weixin').text(user.weixin);
                $('#yuanxi').text(user.yuanxi);
                $('#teachername').text(user.teachername);
                $('#teacherphine').text(user.teacherphine);
            /*    $('#dizhi').text(user.dizhi);
                $('#type').text(user.type);
                $('#shijianstart').text(user.shijianstart);
                $('#shijainend').text(user.shijainend);*/
                $('#beizhu').text(user.beizhu);

                $('#timu').text(user.timu);

                $('#jianjie').text(user.jianjie);


            },
            error: function(xhr, status, error) {
                console.error("请求详情数据失败: " + error);
            }
        });
    });
</script>
</body>
</html>